for each loop java

58

java foreach -

List<String> someList = new ArrayList<String>();
// add "monkey", "donkey", "skeleton key" to someList
for (String item : someList) {
    System.out.println(item);
}

java foreach -

for (String item : someList) {
    System.out.println(item);
}

Comments

Submit
0 Comments